﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Yichat.MicroService.Interface;

namespace Yichat.MicroServive.ClientDemo.Controllers
{
    public class TestController : Controller
    {
        private readonly ILogger<TestController> _logger;
        private readonly IUserService _userService;
        public TestController(ILogger<TestController> logger,
            IUserService userService)
        {
            _logger = logger;
            _userService = userService;
        }

        public IActionResult Index()
        {
            #region 单体架构
            base.ViewBag.Users = _userService.GetUsers(); //三层架构
            #endregion

            return View();
        }
    }
}
